home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / Advanced I⁄O v2.3 / Advanced i⁄o / Makefile < prev    next >
Makefile  |  1995-06-19  |  2KB  |  100 lines

  1. #                Makefile
  2. #         to build and test my working environment
  3. #    (including my i/o library and an arithmetic coding classlib)
  4. #
  5. # To build the library, you may want to edit the list of the library modules
  6. # below (MODULES). Say, if you don't need/want voc, remove all the names
  7. # that contain voc from MODULES= below. Then make the modules you left
  8. # into the library by
  9. #        make lib
  10. # simple 'make' would suffice, too.
  11. #
  12. # To verify the library, do
  13. #    make check-all
  14. # or, more specifically,
  15. #    make vendian_io        (checks Endion I/O and bitstream i/o)
  16. #    make varithm        (checks arithmetic compression/decompression)
  17. #    make vhistogram        (checks histogram operations)
  18. #
  19. # Note, this Makefile was built (and works under) GNU make 3.71
  20. #
  21. # Please check RANLIB below and adjust it to your system if necessary
  22. # (it was made for a BSD-like system)
  23. #
  24. CC=$(HOME)/bin/c++
  25. CCL=$(HOME)/bin/c++l
  26. .SUFFIXES: .cc
  27. MODULES=sys_open.cc filebuf.cc myenv.cc endian_io.cc \
  28.     arithm_coding.cc arithm_model.cc arithm_modadapt.cc \
  29.     arithm_modadh.cc histogram.cc
  30.     
  31. LIBRARY=libserv.a
  32. #RANLIB = (ar d $(LIBRARY) __.SYMDEF || true); ranlib $(LIBRARY) # for BSD
  33. RANLIB = /bin/true     # for Solaris 2.x, HP/UX and other SysV-based
  34.  
  35.  
  36. #    Rules, new style
  37.  
  38. %.o : %.cc
  39.     $(CC) $*.cc
  40.  
  41. % : %.o $(LIBRARY)
  42.     $(CCL) $< $(LIBRARY) -o $@
  43.     ./$@
  44.  
  45. % :: %.cc
  46.     $(CC) $*.cc
  47.     $(CCL) $*.o $(LIBRARY) -o $@
  48.     ./$@
  49.  
  50. #    Rules, old style
  51. #.o:    $*.o $(LIBRARY)
  52. #    $(CCL) $*.o $(LIBRARY) -o $*
  53. #    ./$*
  54. #.cc:     $*.cc $(LIBRARY)
  55. #    $(CC) $*.cc
  56. #    $(CCL) $*.o $(LIBRARY) -o $*
  57. #    ./$*
  58. #.cc.o:
  59. #    $(CC) $*.cc
  60. #
  61.  
  62. # Primary goal
  63.  
  64. # Library
  65.  
  66. lib:    $(LIBRARY)
  67. .PHONY:     lib
  68. .PRECIOUS:    $(LIBRARY)
  69.  
  70. $(LIBRARY)::    $(MODULES)
  71. #             Compile the source files that have been changed 
  72.     $(CC) $?
  73.     listobj=`echo $? | sed s/.cc/.o/g` ; \
  74.     ar rv $(LIBRARY) $$listobj &&    \
  75.     rm $$listobj
  76.     $(RANLIB)
  77.  
  78. # Verification routines
  79. check-all:    vendian_io varithm vhistogram
  80.  
  81. #vendian_io:    vendian_io.o $(LIBRARY)
  82. #    $(CCL) vendian_io.o  $(LIBRARY) -o vendian_io
  83. #    ./vendian_io
  84.  
  85. # Specific dependent goals
  86.  
  87.  
  88. # Dependence rules
  89.  
  90. $(LIBRARY)::    myenv.h
  91.     $(MAKE) -W myenv.cc lib
  92.  
  93. vendian_io.o:    endian_io.h
  94.  
  95. $(LIBRARY)::    arithm.h
  96.     $(MAKE) -W arithm_coding.cc lib
  97.     $(MAKE) -W arithm_model.cc lib
  98. $(LIBRARY)::    arithm.h arithm_modadh.h
  99.     $(MAKE) -W arithm_modadh.cc lib
  100.